package com.server.dao.impl;

import java.util.List;

import com.bean.Product;
import com.server.dao.ProductDao;
import com.server.util.XmlParseHelper;

public class ProductDaoImpl implements ProductDao {
	
	public final static String XML = "product.xml"; 

	@Override
	public List<Product> findAll() {
		List<Product> allProducts = XmlParseHelper.getAll(XML, Product.class);
		return allProducts;
	}

	@Override
	public synchronized void updataQuantity(Product p) {
		XmlParseHelper.updataQuantity(XML, p);
	}

	@Override
	public synchronized void newProduct(Product p) {
		XmlParseHelper.addNode(XML, p);
	}

	@Override
	public void addQuantity(Product p) {
		
	}

	@Override
	public void findById(Product p) {
		
	}

}
